﻿Imports System.Text

Public Class w0002
    Private Sub w0002_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ComboBox1.SelectedIndex = 0
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim tmpI As Integer = 0, tmpX As Integer = 0
        Dim t As Integer = 0
        Dim p As Integer = Val(ComboBox1.Text) - 1
        Dim R As String = ""
        Dim SB As New StringBuilder
        Dim kuadu As Integer = 0

        For i = 0 To general_Ubound
            tmpI = arrJH_sep_I(i, p)
            For j = i + 1 To general_Ubound
                tmpX = arrJH_sep_I(j, p)
                If tmpI <> tmpX Then
                    Exit For
                Else
                    t = t + 1
                End If
            Next
            If t <> 0 Then
                SB.Append(arrQH(i) & vbTab & arrJH_S(i) & vbTab & (t + 1).ToString & vbTab & "跨度:" & vbTab & kuadu.ToString & vbCrLf)
                t = 0
                kuadu = 0
            Else
                kuadu = kuadu + 1
            End If
        Next
        TextBox1.Text = SB.ToString.Trim
    End Sub
End Class